From 361b09576e4cde6415809b508572ca79687bc164 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 17 Feb 2016 20:27:39 +0100 Subject: [PATCH] Remove comments about isset( $string['foo'] ) being true on PHP 5.3 ...but don't remove the code. Calling isset( $bar['foo'] ) without checking that $bar is an array seems not very nice to me. Change-Id: I822c925b6f36bf34902f8075e54f71fe4f6d2566 --- includes/objectcache/ObjectCache.php | 2 -- includes/registration/ExtensionRegistry.php | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/includes/objectcache/ObjectCache.php b/includes/objectcache/ObjectCache.php index 12a673a829..6d26419a6b 100644 --- a/includes/objectcache/ObjectCache.php +++ b/includes/objectcache/ObjectCache.php @@ -269,8 +269,6 @@ class ObjectCache { */ public static function newAccelerator( $params = [], $fallback = null ) { if ( $fallback === null ) { - // The is_array check here is needed because in PHP 5.3: - // $a = 'hash'; isset( $params['fallback'] ); yields true if ( is_array( $params ) && isset( $params['fallback'] ) ) { $fallback = $params['fallback']; } elseif ( !is_array( $params ) ) { diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index bc9b26d70c..33395f74ad 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -234,9 +234,7 @@ class ExtensionRegistry { foreach ( $info['globals'] as $key => $val ) { // If a merge strategy is set, read it and remove it from the value // so it doesn't accidentally end up getting set. - // Need to check $val is an array for PHP 5.3 which will return - // true on isset( 'string'['foo'] ). - if ( isset( $val[self::MERGE_STRATEGY] ) && is_array( $val ) ) { + if ( is_array( $val ) && isset( $val[self::MERGE_STRATEGY] ) ) { $mergeStrategy = $val[self::MERGE_STRATEGY]; unset( $val[self::MERGE_STRATEGY] ); } else { -- 2.20.1